<!DOCTYPE html>
<html>
<head>
<meta name="Keywords" content="{:C('KEY_WORD')}" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="{:C('DESCRIPTION')}" />
<meta name="Author" content="YuZhiyuan - 307090870@qq.com" />
<meta name="Robots" content="index,follow" />
<title>{:C('WEB_SITE')}</title>	
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script><!--Needed for the prettyPhoto to function-->
<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"  type="text/javascript"></script><!--runs the tabs widgets and toggle widgets-->
<script  type="text/javascript" src="__PUBLIC__/js/jquery.validate.js"></script>

<script type="text/javascript" src="__PUBLIC__/js/simplepager.js"></script><!--runs the pagination-->
<script type="text/javascript" src="__ROOT__/Data/Ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<link rel="stylesheet" href="__PUBLIC__/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<link rel="stylesheet" href="__ROOT__/Data/Ueditor/third-party/SyntaxHighlighter/shCoreDefault.css" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {
    $('span.category').hover(function(){
    $(this).next().css('background-color','#e25050');
    },function(){
    $(this).next().css('background-color','#393939');
    });
    
    $(".contact_form").validate({
		submitHandler: function(form) {			
        
            var pid = $('#pId').val();
            var name = $('#name').val();
            var email = $('#email').val();
            var web = $('#web').val();
            var content = $('#content').val();   
			$.ajax({
                type: "POST",
                url: "{:U('Comment/add')}",
                cache: false,
                dataType:"json",
                data: {'pid':pid,'name':name,'email':email,'web':web,'content':content},
                beforeSend:function(XMLHttpRequest){
                    if (0 == pid) {
                        alert('参数错误！');
                        return false;
                    }
                },
                success: function() {
                    $('.alertGreen').remove();
                    $('.contact_form').prepend("<div class='alertGreen'>评论成功！等待审核。</div>");
                    $('.alertGreen').delay(1500).fadeOut(500);

                    $('#submit').attr('disabled','disabled');

                },
                error: function(){
                    alert('请求服务器失败');
                }
            });   
        return false;

		}
   
    
	});

    
});
SyntaxHighlighter.all();

</script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="__PUBLIC__/Css/style.css" rel="stylesheet" type="text/css" />
 
</head>
<body>

	<div id="wrapper">
    
      <div id="main">
        <div id="navigation">
                     <include file="Public:nav"/>

        </div><!--END navigation-->
            <div id="main-content">
            	<div id="post-page">                    
                    <div class="post">
            		<h1 class="title">{$post.atitle}</h1>
                	<span class="twitter"><a href="#"></a></span>
                    <span class="facebook"><a href="#"></a></span>
                    <div class="meta">
                    	<ul >
                        	<li class="admin"><a href="#">{$post.bnickname}</a></li>
                            <li class="date">{$post.aaddtime|date="Y-m-d",###}</li>
                            <li class="category"><a href="#">{$post.c_name}</a></li>
                            <li class="comments">评论(<script type="text/javascript" src="{:U(GROUP_NAME . '/Show/getCmtNum',array('id'=>$post['aid']))}"></script>)</li>
                            <script type="text/javascript" src="{:U(GROUP_NAME . '/Show/setClickInc',array('id'=>$post['aid']))}"></script>
                        </ul>
                    </div><!--end meta-->
                    <span class="main-border"></span>                    
                    <notempty name="post.atitlepic">
                        <img class="post-image" src="{$post.atitlepic}" alt="post image" height="214" width="609" />
                        <p></p>
                    </notempty>   
                    <div class="post-content">
                    {$post.acontent}
                    </div>
                    <span class="main-border"></span>
                    <h1 id="commenth1">评论</h1>
                    
                    <volist name="comments" id="comment">
                    <div class="user-comment">
                    	<div class="avatar"><img src="<empty name='comment.avatar_picture'>__PUBLIC__/Images/noavatar.gif<else />{$comment.avatar_picture}</empty>" alt="avatar" height="51" width="51" /></div>
                        
                        <div class="comment-meta">
                        	<ul>
                            	<li class="comment-author">
                                    
                                 <empty name="comment.web_site">
                                            {$comment.nickname}
                                        <else />
                                            <a href="{$comment.web_site}" target="_blank">{$comment.nickname}</a>
                                        </empty>
                                
                                </li>
                            
                                <li class="comment-date">{$comment.add_time|date='m-d H:i',###}</li>
                                <li class="comment-reply"><a href="#">Reply</a></li>
                            </ul>
                        </div><!--END comment-meta-->
                        	
                        <p>
                            {$comment.content}
                        </p>
                        <div class="clear"></div>
                    </div><!--END user-comment-->
                    <notempty name="comment.child">
                        <volist name="comment.child" id="commentchild">
                            <div class="user-comment reply-comment">
                                <div class="avatar"><img src="<empty name='comment.avatar_picture'>__PUBLIC__/Images/noavatar.gif<else />{$commentchild.avatar_picture}</empty>" alt="avatar" height="51" width="51" /></div>
                                <div class="comment-meta">
                                    <ul>
                                        <li class="comment-author">
                                        <empty name="commentchild.web_site">
                                            {$commentchild.nickname}
                                        <else />
                                            <a href="{$commentchild.web_site}" target="_blank">{$commentchild.nickname}</a>
                                        </empty>
                                        
                                        </li>
                                        <li class="comment-date">{$commentchild.add_time|date='m-d H:i',###}</li>
                                        <li class="comment-reply"><a href="#">Reply</a></li>
                                    </ul>
                                </div><!--END comment-meta-->
                                <p>
                                {$commentchild.content}
                                </p>
                                <div class="clear"></div>
                            </div><!--END user-comment-->
                        </volist>                    
                    </notempty>         
                    </volist>
                    <span class="main-border"></span>
                    
                    <h1 id="comment">Leave a Reply</h1>
                    
                    <form class="contact_form">
                    <ul>
                        
                        <li>
                            <input type="text" id="name" name="name" placeholder="Name" class="required" required/>
                        </li>
                        <li>
                            <input type="email" id="email" name="email" placeholder="Email" class="required" required/>
                            <span class="form_hint">格式"name@something.com"</span>
                        </li>
                        <li>
                            <input type="url" id="web" name="web" placeholder="Website" pattern="(http|https)://.+" class="required" required/>
                            <span class="form_hint">格式"http://baidu.com"</span>
                        </li>
                        <li>
                            <textarea id="content" name="content" cols="40" rows="6" class="required"  required></textarea>
                        </li>
                        <li>
                            <input type="hidden" name="pId" id="pId" value="{$post.aid}" />
                            <input type="submit" id="submit" class="lightgrey" value="评 论"/>
                        </li>
                    </ul>
                </form>		
                </div><!--end post-->
                </div><!--END post-page-->
            </div><!--END main-content-->
        </div><!--END main-->
                <include file="Public:side"/>

        <div class="clear"></div>
        </div><!--End wrapper-->
        <include file="Public:footer"/>
        <script src="__PUBLIC__/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto();
  });
</script>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>

</html>
